package com.metro.qd.iscs;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.metro.json.JacksonMapper;
import org.joda.time.DateTime;

import java.io.Serializable;
import java.util.Objects;

public class PointValue implements Serializable {
    private static final long serialVersionUID = 1L;

    public String point;

    @JsonProperty("time_oc")
    @JsonFormat(pattern = JacksonMapper.PATTERN_DATETIME_ZZZ)
    public DateTime occur;

    @JsonProperty("value")
    public Number val;

    public int quality;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PointValue that = (PointValue) o;
        return point.equals(that.point) &&
                occur.equals(that.occur);
    }

    @Override
    public int hashCode() {
        return Objects.hash(point, occur);
    }
}
